package com.loan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.loan.group.ApplicationAddGroup;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class Application implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

//    @NotNull(message = "客户的id不能为空",groups = {ApplicationAddGroup.class})
    private Integer customerId;

    @TableField(exist = false)
    private Customer customer;

//    @NotNull(message = "选择的产品不能为空",groups = {ApplicationAddGroup.class})
    private Integer proId;

    @TableField(exist = false)
    private Product product;

//    @NotNull(message = "贷款金额不能为空",groups = {ApplicationAddGroup.class})
    private BigDecimal money;


    private Date applyTime;

    /**
     * 1:提交申请
     * 2:审核通过
     * 3:审核拒绝
     */
    private String status;

    @TableField(exist = false)
    public static final String APPLY = "1";

    @TableField(exist = false)
    public static final String APPROVED = "2";

    @TableField(exist = false)
    public static final String REJECTED = "3";

//    @NotBlank(message = "收款账号不能为空",groups = {ApplicationAddGroup.class})
    private String acceptAccount;

    @TableField(exist = false)
    private List<Integer> mortgageIds;

    /**
     * 申请表的抵押资产列表
     */
    @TableField(exist = false)
    private List<Mortgage> mortgageList;

    /**
     * 操作记录
     */
    @TableField(exist = false)
    private List<Process> processList;
}